function doCancel(){
  return true;
}

function doOK(){
  var viewpointName = document.getElementById('txtViewpointName').value;
	var stringBundle = document.getElementById("sbLasuli");
  if('undefined' == typeof viewpointName || viewpointName == ""){
    alert(stringBundle.getString("viewpointDialog.error.nameisnull"));
    return false;
  }
  var pref = new Preferences(PREF_PREFIX);
	var defaultService = pref.getPref("service", DEFAULT_SERVICE);
	var user = pref.getPref("username", DEFAULT_HT_USER);
	var pass = pref.getPref("password", DEFAULT_HT_PASS);

  var uri = defaultService + "viewpoint/";
  var viewpointObject = new Viewpoint();
  viewpointObject.name = viewpointName;
  var res = viewpointObject.httpPost(uri, user, pass);
  if(res == null){
    alert(stringBundle.getString("viewpointDialog.error.servererror"));
    return false;
  }

  var retVals = window.arguments[0];
  retVals.name  = viewpointName;
  retVals.uri = res;
  return true;
}